/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui;

import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;

/**
 *
 * @author Admin
 */
@ManagedBean

public class Role {

    int value;
    String dispayString;

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getDispayString() {
        return dispayString;
    }

    public void setDispayString(String dispayString) {
        this.dispayString = dispayString;
    }

    public Role() {
    }

    public Role(int value, String dispayString) {
        this.value = value;
        this.dispayString = dispayString;
    }

    public  List<Role> getAllRole() {
        List<Role> lr = new ArrayList<Role>();
        lr.add(new Role(2, "Staff"));
        lr.add(new Role(3, "Student"));
        return lr;
    }
    public String getDisplayString(int value){
        for (Role r : getAllRole()) {
            if (r.getValue() == value) {
                return r.getDispayString();
            }
        }
        return "Error";
    }
}
